package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysFile;
import com.school.manager.entity.po.SysFilePo;
import com.school.manager.entity.vo.SysFileVo;
import com.school.manager.mapper.SysFileMapper;
import com.school.manager.service.ISysFileService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：文件业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysFileServiceImpl extends ServiceImpl<SysFileMapper, SysFile> implements ISysFileService {
	
	@Autowired
    private SysFileMapper sysFileMapper;
	
	@Override
	public Page<SysFileVo> page(SysFilePo sysFilePo) {
		QueryWrapper<SysFile> queryWrapper = PageUtil.buildQueryWrapper(sysFilePo, SysFile.class);
        Page<SysFile> page = new Page<>(sysFilePo.getCurrent(), sysFilePo.getSize());
        sysFileMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysFileVo.class);
	}
	


}
